home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 April: Mac OS SDK / Dev.CD Apr 99 SDK1.toast / Development Kits / Interfaces&Libraries / Universal / Interfaces / AIncludes / Processes.a < prev    next >
Encoding:
Text File  |  1998-08-17  |  7.5 KB  |  261 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Processes.a
  3. ;
  4. ;    Contains:    Process Manager Interfaces.
  5. ;
  6. ;    Version:    Technology:    Mac OS 8
  7. ;                Release:    Universal Interfaces 3.2
  8. ;
  9. ;    Copyright:    © 1989-1998 by Apple Computer, Inc., all rights reserved
  10. ;
  11. ;    Bugs?:        For bug reports, consult the following page on
  12. ;                the World Wide Web:
  13. ;
  14. ;                    http://developer.apple.com/bugreporter/
  15. ;
  16. ;
  17.     IF &TYPE('__PROCESSES__') = 'UNDEFINED' THEN
  18. __PROCESSES__ SET 1
  19.  
  20.     IF &TYPE('__MACTYPES__') = 'UNDEFINED' THEN
  21.     include 'MacTypes.a'
  22.     ENDIF
  23.     IF &TYPE('__EVENTS__') = 'UNDEFINED' THEN
  24.     include 'Events.a'
  25.     ENDIF
  26.     IF &TYPE('__FILES__') = 'UNDEFINED' THEN
  27.     include 'Files.a'
  28.     ENDIF
  29.  
  30. ;  type for unique process identifier 
  31. ProcessSerialNumber        RECORD 0
  32. highLongOfPSN             ds.l    1                ; offset: $0 (0)
  33. lowLongOfPSN             ds.l    1                ; offset: $4 (4)
  34. sizeof                     EQU *                    ; size:   $8 (8)
  35.                         ENDR
  36. ; typedef struct ProcessSerialNumber *    ProcessSerialNumberPtr
  37.  
  38.  
  39.                                                             ; Process identifier - Various reserved process serial numbers 
  40. kNoProcess                        EQU        0
  41. kSystemProcess                    EQU        1
  42. kCurrentProcess                    EQU        2
  43. ;  Definition of the parameter block passed to _Launch 
  44. ;  Typedef and flags for launchControlFlags field
  45. ; typedef unsigned short                 LaunchFlags
  46.  
  47.  
  48. launchContinue                    EQU        $4000
  49. launchNoFileFlags                EQU        $0800
  50. launchUseMinimum                EQU        $0400
  51. launchDontSwitch                EQU        $0200
  52. launchAllow24Bit                EQU        $0100
  53. launchInhibitDaemon                EQU        $0080
  54. ;  Format for first AppleEvent to pass to new process.  The size of the overall
  55. ;  buffer variable: the message body immediately follows the messageLength 
  56. AppParameters            RECORD 0
  57. theMsgEvent                 ds        EventRecord        ; offset: $0 (0)
  58. eventRefCon                 ds.l    1                ; offset: $10 (16)
  59. messageLength             ds.l    1                ; offset: $14 (20)
  60. sizeof                     EQU *                    ; size:   $18 (24)
  61.                         ENDR
  62. ; typedef struct AppParameters *        AppParametersPtr
  63.  
  64. ;  Parameter block to _Launch 
  65. LaunchParamBlockRec        RECORD 0
  66. reserved1                 ds.l    1                ; offset: $0 (0)
  67. reserved2                 ds.w    1                ; offset: $4 (4)
  68. launchBlockID             ds.w    1                ; offset: $6 (6)
  69. launchEPBLength             ds.l    1                ; offset: $8 (8)
  70. launchFileFlags             ds.w    1                ; offset: $C (12)
  71. launchControlFlags         ds.w    1                ; offset: $E (14)
  72. launchAppSpec             ds.l    1                ; offset: $10 (16)
  73. launchProcessSN             ds        ProcessSerialNumber ; offset: $14 (20)
  74. launchPreferredSize         ds.l    1                ; offset: $1C (28)
  75. launchMinimumSize         ds.l    1                ; offset: $20 (32)
  76. launchAvailableSize         ds.l    1                ; offset: $24 (36)
  77. launchAppParameters         ds.l    1                ; offset: $28 (40)
  78. sizeof                     EQU *                    ; size:   $2C (44)
  79.                         ENDR
  80. ; typedef struct LaunchParamBlockRec *    LaunchPBPtr
  81.  
  82. ;  Set launchBlockID to extendedBlock to specify that extensions exist.
  83. ; Set launchEPBLength to extendedBlockLen for compatibility.
  84.  
  85. extendedBlock                    EQU        $4C43                ; 'LC' 
  86. extendedBlockLen                EQU        32
  87.  
  88.                                                             ; Definition of the information block returned by GetProcessInformation 
  89. modeLaunchDontSwitch            EQU        $00040000
  90. modeDeskAccessory                EQU        $00020000
  91. modeMultiLaunch                    EQU        $00010000
  92. modeNeedSuspendResume            EQU        $00004000
  93. modeCanBackground                EQU        $00001000
  94. modeDoesActivateOnFGSwitch        EQU        $00000800
  95. modeOnlyBackground                EQU        $00000400
  96. modeGetFrontClicks                EQU        $00000200
  97. modeGetAppDiedMsg                EQU        $00000100
  98. mode32BitCompatible                EQU        $00000080
  99. modeHighLevelEventAware            EQU        $00000040
  100. modeLocalAndRemoteHLEvents        EQU        $00000020
  101. modeStationeryAware                EQU        $00000010
  102. modeUseTextEditServices            EQU        $00000008
  103. modeDisplayManagerAware            EQU        $00000004
  104. modeGuardPageAware                EQU        $00000002
  105. ;  Record returned by GetProcessInformation 
  106. ProcessInfoRec            RECORD 0
  107. processInfoLength         ds.l    1                ; offset: $0 (0)
  108. processName                 ds.l    1                ; offset: $4 (4)
  109. processNumber             ds        ProcessSerialNumber ; offset: $8 (8)
  110. processType                 ds.l    1                ; offset: $10 (16)
  111. processSignature         ds.l    1                ; offset: $14 (20)
  112. processMode                 ds.l    1                ; offset: $18 (24)
  113. processLocation             ds.l    1                ; offset: $1C (28)
  114. processSize                 ds.l    1                ; offset: $20 (32)
  115. processFreeMem             ds.l    1                ; offset: $24 (36)
  116. processLauncher             ds        ProcessSerialNumber ; offset: $28 (40)
  117. processLaunchDate         ds.l    1                ; offset: $30 (48)
  118. processActiveTime         ds.l    1                ; offset: $34 (52)
  119. processAppSpec             ds.l    1                ; offset: $38 (56)
  120. sizeof                     EQU *                    ; size:   $3C (60)
  121.                         ENDR
  122. ; typedef struct ProcessInfoRec *        ProcessInfoRecPtr
  123.  
  124. ;
  125. ; pascal OSErr LaunchApplication(LaunchPBPtr LaunchParams)
  126. ;
  127.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  128.         ; parameters:
  129.         ;    LaunchParams    => A0
  130.         ; returns:
  131.         ;    OSErr           <= D0
  132.         _LaunchApplication:    OPWORD    $A9F2
  133.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  134.         IMPORT_CFM_FUNCTION LaunchApplication
  135.     ENDIF
  136.  
  137. ;
  138. ; pascal OSErr LaunchDeskAccessory(const FSSpec *pFileSpec, ConstStr255Param pDAName)
  139. ;
  140.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  141.         Macro
  142.         _LaunchDeskAccessory
  143.             move.w              #$0036,-(sp)
  144.             dc.w                $A88F
  145.         EndM
  146.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  147.         IMPORT_CFM_FUNCTION LaunchDeskAccessory
  148.     ENDIF
  149.  
  150. ;
  151. ; pascal OSErr GetCurrentProcess(ProcessSerialNumber *PSN)
  152. ;
  153.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  154.         Macro
  155.         _GetCurrentProcess
  156.             move.w              #$0037,-(sp)
  157.             dc.w                $A88F
  158.         EndM
  159.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  160.         IMPORT_CFM_FUNCTION GetCurrentProcess
  161.     ENDIF
  162.  
  163. ;
  164. ; pascal OSErr GetFrontProcess(ProcessSerialNumber *PSN)
  165. ;
  166.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  167.         Macro
  168.         _GetFrontProcess
  169.             moveq               #-1,D0
  170.             move.l              D0,-(sp)
  171.             move.w              #$0039,-(sp)
  172.             dc.w                $A88F
  173.         EndM
  174.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  175.         IMPORT_CFM_FUNCTION GetFrontProcess
  176.     ENDIF
  177.  
  178. ;
  179. ; pascal OSErr GetNextProcess(ProcessSerialNumber *PSN)
  180. ;
  181.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  182.         Macro
  183.         _GetNextProcess
  184.             move.w              #$0038,-(sp)
  185.             dc.w                $A88F
  186.         EndM
  187.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  188.         IMPORT_CFM_FUNCTION GetNextProcess
  189.     ENDIF
  190.  
  191. ;
  192. ; pascal OSErr GetProcessInformation(const ProcessSerialNumber *PSN, ProcessInfoRec *info)
  193. ;
  194.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  195.         Macro
  196.         _GetProcessInformation
  197.             move.w              #$003A,-(sp)
  198.             dc.w                $A88F
  199.         EndM
  200.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  201.         IMPORT_CFM_FUNCTION GetProcessInformation
  202.     ENDIF
  203.  
  204. ;
  205. ; pascal OSErr SetFrontProcess(const ProcessSerialNumber *PSN)
  206. ;
  207.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  208.         Macro
  209.         _SetFrontProcess
  210.             move.w              #$003B,-(sp)
  211.             dc.w                $A88F
  212.         EndM
  213.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  214.         IMPORT_CFM_FUNCTION SetFrontProcess
  215.     ENDIF
  216.  
  217. ;
  218. ; pascal OSErr WakeUpProcess(const ProcessSerialNumber *PSN)
  219. ;
  220.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  221.         Macro
  222.         _WakeUpProcess
  223.             move.w              #$003C,-(sp)
  224.             dc.w                $A88F
  225.         EndM
  226.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  227.         IMPORT_CFM_FUNCTION WakeUpProcess
  228.     ENDIF
  229.  
  230. ;
  231. ; pascal OSErr SameProcess(const ProcessSerialNumber *PSN1, const ProcessSerialNumber *PSN2, Boolean *result)
  232. ;
  233.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  234.         Macro
  235.         _SameProcess
  236.             move.w              #$003D,-(sp)
  237.             dc.w                $A88F
  238.         EndM
  239.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  240.         IMPORT_CFM_FUNCTION SameProcess
  241.     ENDIF
  242.  
  243.     IF ¬ OLDROUTINELOCATIONS THEN
  244. ;    ExitToShell was previously in SegLoad.h
  245. ;
  246.  
  247. ;
  248. ; pascal void ExitToShell(void )
  249. ;
  250.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  251.         _ExitToShell:    OPWORD    $A9F4
  252.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  253.         IMPORT_CFM_FUNCTION ExitToShell
  254.     ENDIF
  255.  
  256.     ENDIF
  257.  
  258.     ENDIF ; __PROCESSES__ 
  259.  
  260.